package cn.rongdao.jrkabao.ui.IdentificationVerificate.IdentificationWithValidationItem.status;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.mifengkong.frtools.ui.activity.FRStartActivity;
import com.mifengkong.frtools.ui.statusbar.FRStatusBar;
import com.mifengkong.frwidget.titlebar.TitleBarUIComponent;

import butterknife.BindView;
import cn.rongdao.jrkabao.R;
import cn.rongdao.jrkabao.bean.loan.ApplySuccessBean;
import cn.rongdao.jrkabao.constant.InfoConstant;

/**
 * Created by jiangyongxing on 2017/9/20.
 * 描述：找不到邮箱的界面，即表示实名不匹配的界面
 */

public class StatusForNotFoundMailActivity extends StatusBaseActivity {

    public static final int NOT_FOUND_MAIN_RETRY = 101;

    @BindView(R.id.asfnfm_titlebar)
    TitleBarUIComponent mTitleBarUIComponent;
    @BindView(R.id.asfnfm_title)
    TextView title;
    @BindView(R.id.asfnfm_desc)
    TextView desc;
    @BindView(R.id.asfnfm_retry_btn)
    LinearLayout retryBtn;

    public static void start(Activity context, String cateId, String code, String pageSource) {
        Bundle bundle = new Bundle();
        bundle.putString(InfoConstant.CATE_ID, cateId);
        bundle.putString("code", code);
        bundle.putString(InfoConstant.PAGE_SOURCE, pageSource);
        FRStartActivity.startForResult(context, StatusForNotFoundMailActivity.class, bundle, 0);
    }


    @Override
    protected void initView() {
        super.initView();
        FRStatusBar.setTranslucentForImageView(this, findViewById(R.id.asfnfm_rootview));
        initTitleBar();
        retryBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                setResult(NOT_FOUND_MAIN_RETRY);
                finish();
            }
        });
    }

    @Override
    protected void parseData(ApplySuccessBean data) {
        title.setText(data.getPage_msg().getBig_title());
        desc.setText(data.getPage_msg().getSmall_title());
    }

    private void initTitleBar() {
        mTitleBarUIComponent.initLeftBack(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
        mTitleBarUIComponent.initTitle("信用卡验证");

    }

    @Override
    protected int layoutRes() {
        return R.layout.activity_status_for_not_found_mail;
    }
}
